<template>
	<view class="service">
		<view class="online-time">在线时间：周一到周六9:00-18:00</view>
		<view class="service-item">
			<text class="iconfont icon-weixin" style="color:#55B838;font-size:110rpx"></text>
			<view class="service-text" @click="copyValue('yingxiaozui')">
				<text class="type">官方客服微信号</text>
				<text class="value">yingxiaozui</text>
				<text class="copy">复制添加微信</text>
			</view>
		</view>
		<view class="service-item">
			<text class="iconfont icon-E-mail" style="color:#5997EB;font-size:110rpx"></text>
			<view class="service-text" @click="copyValue('haifan168@qq.com')">
				<text class="type">E-mail</text>
				<text class="value">haifan168@qq.com</text>
				<text class="copy">复制邮箱</text>
			</view>
		</view>
		<view class="service-item">
			<image class="image" mode="widthFix" src="@/static/icons/qq.png"></image>
			<view class="service-text" @click="copyValue('1490016454')">
				<text class="type">QQ号</text>
				<text class="value">1490016454</text>
				<text class="copy">复制QQ号</text>
			</view>
		</view>
		<!--智能搜索-->
		<ai-search ref="aiSearch"></ai-search>
	</view>
</template>

<script>
export default {
	data() {
		return {};
	},
	components: {},
	onLoad() {
	},
	onShow() {
		this.$nextTick(() => {
			uni.getClipboardData({
				success: res => {
					if (res.data && this.$store.state.common.aiSearch) {
						this.$refs.aiSearch.open(res.data);
						this.$store.commit({
							type: 'setAiSearch',
							aiSearch: false
						});
					}
				}
			});
		});
	},
	onHide() {
		this.$refs.aiSearch.close();
	},
	methods: {
		phoneCall(phone) {
			uni.makePhoneCall({
				phoneNumber: phone
			});
		},
		copyValue(val) {
			console.log(val);
			uni.setClipboardData({
				data: val,
				success: function() {
					console.log('success');
				}
			});
		}
	}
};
</script>
<style lang="scss" scoped>
.service {
	background: #f6f7fa;
	height: 100vh;
	.online-time {
		background: #fffaed;
		width: 100%;
		height: 64rpx;
		line-height: 64rpx;
		text-align: center;
		color: #ad8888;
		font-size: 28rpx;
	}
	.service-item {
		width: 716rpx;
		height: 206rpx;
		background: rgba(255, 255, 255, 1);
		border-radius: 16rpx;
		margin: 20rpx auto;
		display: flex;
		align-items: center;
		justify-content: space-around;
		.image {
			margin: 0 40rpx;
			width: 110rpx;
		}
		.icon {
			font-size: 68rpx;
			margin: 0 40rpx;
		}
		.icon-tousudianhua {
			font-size: 54rpx;
			margin: 0 40rpx;
			color: $main-color;
		}
		.icon-E-mail {
			font-size: 54rpx;
			margin: 0 40rpx;
			color: #5997eb;
		}
		.service-text {
			display: flex;
			flex-direction: column;
			justify-content: center;
			align-items: center;
			width: 250rpx;
			margin-right: 40rpx;
			.type {
				font-size: 28rpx;
				color: #221d2c;
			}
			.value {
				font-size: 26rpx;
				color: #717076;
				margin: 10rpx 0 20rpx;
				/*margin-top: 20rpx;*/
			}
			.copy {
				width: 214rpx;
				height: 48rpx;
				background: #ffeeed;
				border-radius: 50rpx;
				display: block;
				color: $main-color;
				font-size: 26rpx;
				@include flexBox(center, center);
				.icon-boda {
					margin-right: 10rpx;
					margin-left: -20rpx;
				}
			}
		}
	}

	.service-list {
		display: flex;
		justify-content: space-between;
		width: 716rpx;
		margin: 0 auto;
		.qq-svg {
			width: 75rpx;
			height: 80rpx;
		}
		.item {
			width: 345rpx;
			height: 226rpx;
			background: rgba(255, 255, 255, 1);
			opacity: 1;
			border-radius: 16rpx;
			display: flex;
			justify-content: center;
			align-items: center;
			flex-direction: column;
			color: #221d2c;
			font-size: 26rpx;
			i {
				font-size: 70rpx;
				display: block;
				margin-bottom: 6rpx;
				margin-top: -20rpx;
			}
			.icon-kefudianhua {
				color: #f7a201;
			}
			.icon-E-mail {
				color: #5997eb;
			}
			.value {
				color: #717076;
				width: 100%;
				text-align: center;
				padding: 0 10rpx;
				@include ellipsis(1);
			}
		}
	}
	.copy-wx {
		width: 336rpx;
		height: 80rpx;
		margin: 80rpx auto 0 auto;
	}
}
</style>
